$(function () {
    $(".register_pwd").change(function () {
        check_input(/^[a-zA-Z\d_]{8,}$/,$(this).val(),$(this))
    })
    $(".register_rpwd").change(function () {
        if($(this).val() == $(".register_pwd").val()){
            $(this).parent().parent().prop("class","weui-cell weui-cell_success").find("i").prop("class","weui-icon-success")
        }else{
            $(this).parent().parent().prop("class","weui-cell weui-cell_warn").find("i").prop("class","weui-icon-warn")
        };
    })
    $(".register_yzm").change(function () {
        check_input(/^[0-9_]{4}$/,$(this).val(),$(this))
    })
//  $(".register_click").click(function () {
//      console.log(0)
//      if(/^1(3|4|5|7|8)\d{9}$/.test($(".register_phone").val()) && /^[a-zA-Z\d_]{8,}$/.test($(".register_pwd").val()) && /^[0-9_]{4}$/.test($(".register_yzm").val()) && $(".register_rpwd").val() == $(".register_pwd").val()){
//          console.log(1);
//          $.ajax({
//              url:"../../../front/php/register.php",
//              data: {phone:$(".register_phone").val(),pwd:$(".register_pwd").val(),yzm:$(".register_yzm").val()},
//              dataType:"json",
//              type:"GET",
//              success:function (d) {
//                  if(d.code == "S"){
//                      window.location.href = "../fill_info.html"
//                  }
//              }
//          })
//      }
//  })
    function check_input(reg,val,that) {
        if(reg.test(val)){
            that.parent().parent().prop("class","weui-cell weui-cell_success").find("i").prop("class","weui-icon-success")
        }else{
            that.parent().parent().prop("class","weui-cell weui-cell_warn").find("i").prop("class","weui-icon-warn")
        };
    }
})